'use strict';

const Controller = require('egg').Controller;

class RegisterController extends Controller {
  async index() {
    const { ctx } = this;
    // ctx.body = {
    //   post: ctx.request.body,
    //   username: ctx.request.body.username,
    //   password: ctx.request.body.password,
    // };
    const data = ctx.request.body;
    const res = await ctx.service.register.register(data);
    ctx.body = res;
  }
  async userup() {
    const { ctx } = this;
    const data = ctx.request.body;
    const res = await ctx.service.register.userup(data);
    ctx.body = res;
  }
}

module.exports = RegisterController;
